package com.itheima;

public class UserHolder {


    private static ThreadLocal<Integer> id = new ThreadLocal<Integer>();

    public static Integer getUserId() {
        return id.get();
    }

    public static void setUserId(Integer userId) {
        id.set(userId);
    }

    public static void removeFromThreaLocal() {
        id.remove();
    }
}
